package com.keepmoving.service.impl;

import com.keepmoving.dao.CoachDao;
import com.keepmoving.po.Coach;
import com.keepmoving.service.CoachService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author xf
 * 教练业务逻辑层实现类
 */
@Service
public class CoachServiceImpl implements CoachService {


    @Resource
    CoachDao coachDao;

    @Override
    public List<Coach> showAll() {
        return coachDao.showAll();
    }

    @Override
    public Coach showByCoId(int coId) {
        return coachDao.showByCoId(coId);
    }

    @Override
    public boolean addCoach(Coach coach) {
        return coachDao.addCoach(coach) > 0 ? true : false;
    }

    @Override
    public boolean deleteCoach(int coId) {
        return coachDao.deleteCoach(coId) > 0 ? true : false;
    }

    @Override
    public boolean update(Coach coach) {
        return coachDao.update(coach) > 0 ? true : false;
    }
}
